Large brace-block initialisation makes CC Mode slow: Fix.
authorAlan Mackenzie <acm@muc.de>
Tue, 13 Dec 2011 18:47:08 +0000 (18:47 +0000)
committerAlan Mackenzie <acm@muc.de>
Tue, 13 Dec 2011 18:47:08 +0000 (18:47 +0000)
commit24e593c398c009aaffb8297f6a7b1eb6454de72e
tree8010f496b6cb2bf4679bd36475713155b6b7d217
parente8131bd32300cfd4470c7c2a1c7637db5401f1ac
Large brace-block initialisation makes CC Mode slow: Fix.
Tidy up and accelerate c-in-literal, etc. by using the c-parse-state
routines.  Limit backward searching in c-font-lock-enclosing.decl.

cc-engine.el (c-state-pp-to-literal): Return the pp-state and literal
type in addition to the limits.
(c-state-safe-place): New defun, extracted from c-state-literal-at.
(c-state-literal-at): Use the above new defun.
(c-slow-in-literal, c-fast-in-literal): Removed.
(c-in-literal, c-literal-limits): Amended to use c-state-pp-to-literal.

cc-fonts.el (c-font-lock-enclosing-decls): Check for being in a literal.
Add a limit for backward searching.

cc-mode.el (awk-mode): Don't alias c-in-literal to c-slow-in-literal.
lisp/ChangeLog
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-mode.el